#include<iostream>
#include<fstream>

using namespace std;

double f(double x)
{
    return (x*x*x*x*x*x*x*x - 8*x*x*x*x*x*x*x + 28*x*x*x*x*x*x - 56*x*x*x*x*x
            + 70*x*x*x*x - 56*x*x*x + 28*x*x - 8*x + 1);
}

double g(double x)
{
    return ((((((((x - 8)*x + 28)*x - 56)*x + 70)*x - 56)*x + 28)*x - 8)*x + 1);
}

double h(double x)
{
    return ((x-1) * (x-1) * (x-1) * (x-1) * (x-1) * (x-1) * (x-1) * (x-1));
}

int main()
{
    double eps = (1.01 - 0.99) / 100;

    ofstream fout;
    fout.open("dataA.txt", ios::out);
    // fout << "Values by f(x): " << endl;
    for (int i = 0; i <= 100; i++)
    {
        fout << f(0.99 + i * eps);
        if (i != 100) fout << " ";
    }
    fout << endl;

    // fout << "Values by g(x): " << endl;
    for (int i = 0; i <= 100; i++)
    {
        fout << g(0.99 + i * eps) << " ";
        if (i != 100) fout << " ";
    }
    fout << endl;

    // fout << "Values by h(x): " << endl;
    for (int i = 0; i <= 100; i++)
    {
        fout << h(0.99 + i * eps) << " ";
        if (i != 100) fout << " ";
    }
    fout << endl;

    fout.close();
    cout << "Finish printing." << endl;

    return 0;
}